#!/usr/bin/python
import re ,os 

dev_list=''.join(os.popen("/sbin/sfdisk -s").read().split("\n")[:-2])

list=re.findall(r'\/dev\/sd[a-z]', dev_list)

_disk_io_dict={}

def disk_io():
    for f  in list:

        os.environ['disk_name']=str(f)

        partitions_name, _ , x , y = ",".join(os.popen("iostat $disk_name ").read().split("\n")[-3].split()).split(',')[:4]

   	r_IO=float(x)*1024
	
   	w_IO=float(y)*1024

        _disk_io_dict[ "diskthroughput_" + partitions_name ] = str(r_IO) + "," + str(w_IO)
  
        return _disk_io_dict

_disk_io_dict=disk_io()

if __name__ == '__main__':
    disk_io()
